package com.atguigu.newmvc.service;

import com.atguigu.newmvc.mapper.EmpMapper;
import com.atguigu.newmvc.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpMapper empMapper;
    @Override
    public Employee getEmpById(Integer id) {
        return empMapper.getEmpById(id);
    }

    @Override
    public void addEmp(Employee employee) {
        empMapper.addEmp(employee);

    }

    @Override
    public void delEmp(Integer id) {
        empMapper.delEmp(id);
    }

    @Override
    public void updateEmp(Employee employee) {
        empMapper.updateEmp(employee);
    }

    @Override
    public List<Employee> getAllEmp() {
       List<Employee> employeeList =  empMapper.getAllEmp();
       return employeeList;
    }
}
